<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('订单列表')" />
    <th:block th:include="include :: bootstrap-select-css" />
</head>
<body class="gray-bg">
<div class="container-div">
    <div class="row">
        <div class="col-sm-12 search-collapse">
            <form id="operlog-form">
                <div class="select-list">
                    <ul>
                        <li>
                            任务名称：<input type="text" name="jobName"/>
                        </li>
                        <li>
                            线程名称：<input type="text" name="threadName"/>
                        </li>
                        <li>
                            业务类型：<select name="businessType">
                            <option value="">所有</option>
                            <option value="查询">查询</option>
                            <option value="下单">下单</option>
                            <option value="查询并下单">查询并下单</option>
                        </select>
                        </li>
                        <li>
                            操作类型：<select name="operationType">
                                <option value="">所有</option>
                                <option value="手动">手动</option>
                                <option value="定时">定时</option>
                            </select>
                        </li>
                        <li>
                            创建人：<input type="text" name="createBy"/>
                        </li>
                        <li>
                            <a class="btn btn-primary btn-rounded btn-sm" onclick="searchPre()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                            <a class="btn btn-warning btn-rounded btn-sm" onclick="resetPre()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                        </li>
                    </ul>
                </div>
            </form>
        </div>


        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table"></table>
        </div>
    </div>
</div>

<th:block th:include="include :: footer" />
<th:block th:include="include :: bootstrap-select-js" />
<script th:inline="javascript">
    var prefix = ctx + "business/corn";

    $(function() {
        var options = {
            url: prefix + "/list",
            modalName: "执行日志",
            queryParams: queryParams,
            columns: [{
                checkbox: true
            },{
                title: "序号",
                formatter: function (value, row, index) {
                    return $.table.serialNumber(index);
                }
            },
                {
                    field: 'jobName',
                    title: '任务名称',
                    align: "center",
                    formatter: function(value, row, index) {
                        return '<div style="width:200px;">'+value+'</div>';
                    }
                },
                {
                    field: 'threadName',
                    title: '线程名称',
                    align: "center",
                    formatter: function(value, row, index) {
                        return '<div style="width:150px;">'+value+'</div>';
                    }
                },
                {
                    field: 'businessType',
                    title: '业务类型',
                    align: "center",
                    formatter: function(value, row, index) {
                        return '<div style="width:80px;">'+value+'</div>';
                    }
                },
                {
                    field: 'operationType',
                    title: '操作类型',
                    align: "center"
                },
                {
                    field: 'requestDate',
                    title: '请求时间',
                    align: "center",
                    formatter: function(value, row, index) {
                        return '<div style="width:150px;">'+value+'</div>';
                    }
                },
                {
                    field: 'requestData',
                    title: '请求参数',
                    align: "center",
                    formatter: function(value, row, index) {
                        return $.table.tooltip(value);
                    }
                },
                {
                    field: 'responeDate',
                    title: '响应时间',
                    align: "center",
                    formatter: function(value, row, index) {
                        return '<div style="width:150px;">'+value+'</div>';
                    }
                },
                {
                    field: 'responeData',
                    title: '响应参数',
                    align: "center",
                    formatter: function(value, row, index) {
                        return $.table.tooltip(value);
                    }
                },
                {
                    field: 'operationName',
                    title: '操作人',
                    align: "center"
                },{
                    field: 'content',
                    title: '内容',
                    align: "center",
                    formatter: function(value, row, index) {
                        return $.table.tooltip(value);
                    }
                },
                {
                    field: 'remark',
                    title: '备注',
                    align: "center",
                    formatter: function(value, row, index) {
                        if(value == null){
                            value = '-'
                        }
                        return '<div style="width:200px;">'+value+'</div>';
                    }
                },
                {
                    field: 'createBy',
                    title: '创建人',
                    align: "center"
                },
                {
                    field: 'createTime',
                    title: '创建时间',
                    align: "center",
                    formatter: function(value, row, index) {
                        return '<div style="width:150px;">'+value+'</div>';
                    }
                },]
        };
        $.table.init(options);
    });
    function queryParams(params) {
        var search = $.table.queryParams(params);
        return search;
    }

    function searchPre() {
        $.table.search('operlog-form', 'bootstrap-table');
    }

    function resetPre() {
        $("#operlog-form")[0].reset();
        $.table.search('operlog-form', 'bootstrap-table');
    }

    function add() {
        $.operate.add();
    }

</script>
</body>
</html>
